#!/bin/bash

SERVICE_NAME=player-server
PROJECT_DIR=/root/player-server

echo "===> 停止服务 $SERVICE_NAME"
systemctl stop $SERVICE_NAME

echo "===> 进入项目目录 $PROJECT_DIR"
cd $PROJECT_DIR || exit

echo "===> 拉取最新代码..."
git pull

echo "===> 设置权限（可选）"
chmod -R 755 $PROJECT_DIR

echo "===> 启动服务 $SERVICE_NAME"
systemctl start $SERVICE_NAME

echo "===> 查看服务状态"
systemctl status $SERVICE_NAME

